// ==================================================================================
// Shared Genomics Project MPI Codebase
// Version 1.0 30/04/2010
//
// (c) 2010 University of Manchester all rights reserved
//
// This file is distributed under the GNU General Public License, Version 2.  
// Please see the file COPYING.txt for more details
// ==================================================================================

#ifndef _DOUBLEFILE_H_
#define _DOUBLEFILE_H_

#include "options.h"

#ifdef __cplusplus
extern "C" {
#endif

/*!
\file
\ingroup	gio
\brief		Double Array from binary file */

/*!
\brief Write a double array to a binary file.
\details 
	Binary file created using a file stem of \ref selected_options::szRunId and a particular file suffix.<br>
	Files are created locally then copied to the remote central file server.
\param [in] src double array to write to binary file
\param [in] nSrc Size of the double array
\param [in] ops Output file specificiation
\param [in] suffix File suffix
\returns 1 on success, 0 on failure
*/
int doublefile_write(double *src, int nSrc, struct selected_options *ops, char *suffix);

/*!
\brief Read a double array from binary file in the current working directory.
\details 
	Binary file read using a file stem of \ref selected_options::szRunId and a particular file suffix.<br>
	The working directory is read from \ref selected_options::ldir.
\param [in] ops Pointer to the options array.
\param [in] suffix File suffix
\param [in, out] nSize Pointer where the array size is written ti
\returns double array or NULL on failure
*/
double* doublefile_read(struct selected_options *ops, char *suffix, int *nSize);

#ifdef __cplusplus
}
#endif

#endif // _DOUBLEFILE_H_
